package basics;

public class PureDenseMatrix {

	private DenseVector[] matrix;

	public PureDenseMatrix(int n, int m) {
		matrix = new DenseVector[n];
		for (int i = 0; i < n; i++) {
			matrix[i] = new DenseVector(m);
		}
	}

	public double trace() {
		double sum = 0;
		for (int i = 0; i < matrix.length; i++) {
			sum += matrix[i].get(i);
		}

		return sum;
	}

	public PureDenseMatrix times(double d) {
		for (DenseVector v : matrix) {
			v.entrywiseProduct(d);
		}

		return this;
	}
}
